{{- extends "layout/default" }}
{{- import "blocks/pagination" }}
{{- import "blocks/underlinenav" }}
{{- block body() }}
<div class="row justify-content-center g-4">
  <h1 class="text-center"><i class="bi bi-people me-2"></i>Latest works by followed</h1>

  <div class="col-12">

    <div class="d-flex flex-column flex-md-row align-items-center justify-content-center justify-content-md-between mx-auto mb-4">
      {{- Mode := isset(Queries.mode) ? Queries.mode : "safe" }}
      {{- url := "/following_works" }}
      {{- path := slice("all", "safe", "r18") }}
      {{- name := slice("All", "Safe", "R-18")}}
      {{- yield UnderlineNav(baseURL=url, paths=path, names=name, activeState=Mode)}}
    </div>

    <!-- Main content -->
    <div class="row row-cols-2 row-cols-md-4 row-cols-lg-6 g-4">
      {{- if len(.Artworks) > 0 }}
        {{- include "fragments/small-tn" .Artworks }}
      {{- else }}
      <div class="alert alert-light w-25 mx-auto" role="alert">
        <p class="text-center mb-0">Nothing here yet&#8212;find a user to follow!</p>
      </div>
      {{- end }}
    </div>

  <!-- Pagination -->
  {{- if len(.Artworks) > 0 }}
    {{- url :=  "/self/following_works" + "?mode=" + .Mode + "&page=" }}
    {{- paginationData := createPaginator(url, "#checkpoint", .Page, -1, 1, 5) }}
    {{- yield pagination(data=paginationData) }}
  {{- end }}

</div>
{{- end }}
